def sum():
    sum=0
    n=input('输入一个整数N:')
    for i in range(1,int(n)+1):
        sum += i
    print("1到N求和的结果:",sum)
sum()